Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution #1715

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Solution #1715

wants to merge 3 commits into from

Conversation

chiper9
Copy link

@chiper9 chiper9 commented Feb 2, 2025

No description provided.

app/main.py Outdated
Comment on lines 16 to 20
else:
raise (
TypeError(f"Unsupported operand type(s):"
f" 'Distance' and {type(other)}")
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to add "else" because the other two conditions have "return", thus it'll never reach "else" statement if some "if" statement is run

Comment on lines +11 to +12
def __add__(self, other: int | float) -> "Distance":
if isinstance(other, Distance):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix annotation. "other" can also be Distance object

f" 'Distance' and {type(other)}")
)

def __iadd__(self, other: int | float) -> "Distance":
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix annotation. "other" can also be Distance object

app/main.py Outdated
Comment on lines 35 to 37
else:
raise TypeError(f"Unsupported operand type(s): "
f"'Distance' and {type(other)}")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to add "else" because the other two conditions have "return", thus it'll never reach "else" statement if some "if" statement is run

app/main.py Outdated
Comment on lines 44 to 46
else:
raise TypeError(f"Unsupported operand type(s): "
f"'Distance' and {type(other)}")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to add "else" because the other two conditions have "return", thus it'll never reach "else" statement if some "if" statement is run

app/main.py Outdated
Comment on lines 80 to 82
else:
raise TypeError(f"Unsupported operand type(s): "
f"'Distance' and {type(other)}")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to add "else" because the other two conditions have "return", thus it'll never reach "else" statement if some "if" statement is run

app/main.py Outdated
Comment on lines 89 to 93
else:
raise (
TypeError(f"Unsupported operand type(s): "
f"'Distance' and {type(other)}")
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to add "else" because the other two conditions have "return", thus it'll never reach "else" statement if some "if" statement is run

raise TypeError(f"Unsupported operand type(s): "
f"'Distance' and {type(other)}")

def __ge__(self, other: int | float) -> bool:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix annotation. "other" can also be Distance object

raise TypeError(f"Unsupported operand type(s): "
f"'Distance' and {type(other)}")

def __le__(self, other: int | float) -> bool:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix annotation. "other" can also be Distance object

raise TypeError(f"Unsupported operand type(s): "
f"'Distance' and {type(other)}")

def __eq__(self, other: int | float) -> bool:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix annotation. "other" can also be Distance object

@chiper9 chiper9 requested a review from MNDonut February 4, 2025 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants